<?php
	$tool_buttons = array
	(
		'back' => array
		(
			'image'=>'btnList.gif', 
			'text'=>LANG_VIEW_SOURCE, 
			'url'=>'/spanel/viewsource/index/appconfig/'
		),
	);
	$this->helpers->htmlx->MenuText($this->page_title, "edit.gif");
	$this->helpers->toolbars->Toolbar($tool_buttons);
	
	$this->helpers->html->form('');
	echo "<table class = 'eva' style = 'width: 100%;'>";
	$this->helpers->htmlx->TableHeaderRow(LANG_VARIABLES);
	
	//displays variables
	foreach ($this->data[variables] as $key => $value)
	{
		if (($value == 'true')||($value == 'false'))
		{
			$value_array = array(array('0'=>'true', '1'=>'true'), array('0'=>'false', '1'=>'false'));
			$this->helpers->htmlx->ComboboxRow($key, 'variables['.$key.']', $value_array, $value, '', '', '', $this->data[comments][$key]);
		}
		else
		{
			$this->helpers->htmlx->InputTextRow($key, 'variables['.$key.']', $value, '', $this->data[comments][$key]);
		}
		$this->helpers->html->Hidden('comments['.$key.']', $this->data[comments][$key]);
	}
	echo "</table>";
	
	//displays arrays
	foreach ($this->data[arrays] as $key=>$array)
	{
		echo "<table class = 'eva' style = 'width: 100%;'>";
		$this->helpers->htmlx->TableHeaderRow('<u>'.ucfirst(LANG_TITLE).'</u>: '.$key."<br />&nbsp;".$this->data[comments][$key]);
		$this->helpers->html->Hidden('comments['.str_replace('$', '', $key).']', $this->data[comments][$key]);
		
		//displays array elements
		foreach ($array as $k=>$v)
		{
			$k = str_replace(' ', '', $k);
			$key = str_replace('$', '', $key);
			$this->helpers->htmlx->InputTextRow($k, "arrays[$key][$k]", $v);
		}
		echo "</table>";
	}
	$this->helpers->htmlx->SubmitTable('submit', '');
	echo "</form>";
?>